console.log('模型点击', $event)
const setFormSelect = this.getApiPage().getApiWidgetByAliasName('edit-form').widgetObj;
const prefix = this.pageObj.getVariables().find(v => v.name === 'environmentType')?.value || '';

function baseGet (url) {
    const headers = { "Content-type": "application/json" }
    return fetch(url, { headers }).then(res => res.json())
}

baseGet(`/${prefix}Basics/basics-main/system/equipmentObject/listDetailByEquipmentCode?equipmentTypeCode=camera&areaId=${ $event.id }`)
    .then(({ resultCode, result } = {}) => {
        if (resultCode === '000000' && Array.isArray(result?.rows)) {
            const devices = result.rows.map(i=> ({
                ...i,
                name: i.equipmentName,
                value: i.equipmentCode
            }))
            setFormSelect.asyncSelectOptions('sourceDeviceId', devices)
            setFormSelect.tempData = json.result.rows
        }
    })

const form = this.getApiPage().retrievePlugin('base-forms')
form.setFormData('form_19', {
    occurrencePlace: $event.name,
    areaId: $event.id,
    eventPoint: String($event.position[0])+','+ String($event.position[1])+','+ String($event.position[2]),
    xCoordinate: $event.position[0],
    yCoordinate: $event.position[1],
    zCoordinate: $event.position[2],
}) // add
form.setFormData('form_20', {
    occurrencePlace: $event.name,
    areaId: $event.id,
    eventPoint: String($event.position[0])+','+ String($event.position[1])+','+ String($event.position[2]),
    xCoordinate: $event.position[0],
    yCoordinate: $event.position[1],
    zCoordinate: $event.position[2],
}) // detail


this.widgetObj.gisMap.showOrHideAllArea(false)

